package com.dpfmanage.api.project.dpfmanage.common;


import io.swagger.annotations.ApiModel;

@ApiModel("统一响应体")
public class BaseResponse<T> {
    Long code;
    String msg;
    T data;

    public BaseResponse(Long code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public BaseResponse(Long code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public BaseResponse(T data) {
        this.code = ReturnCodeConst.SUCCESS;
        this.msg = "成功";
        this.data = data;
    }

    public BaseResponse() {
        this.code = ReturnCodeConst.SUCCESS;
        this.msg = "成功";
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Long getCode() {
        return code;
    }

    public void setCode(Long code) {
        this.code = code;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
